﻿using Lucene.Server.Client;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SearchServer.Client
{
    internal class Program
    {
        static QueryClient queryClient = new QueryClient("http://localhost:9999", "client", "client");

         static void Main(string[] args)
        {
            // 创建ClientWrapper实例，用于包装查询请求。
            // 这里指定了查询类型为COUNT，从"supervision"索引中查找tt字段等于"aaa"的记录数量
            ClientWrapper clientWrapper = ClientWrapper.Create()
                        .Select("*")
                        .From("SharesCninfo")
                        .Phrase("AnnouncementContent", "智能眼镜",0);
            String str = queryClient.Request(clientWrapper).Result;

            Console.WriteLine(clientWrapper.Build());
            Console.WriteLine( str);
        }
    }
}
